using Nop.Web.Framework.Localization;
using Nop.Web.Framework.Mvc.Routes;
using System.Web.Mvc;
using System.Web.Routing;

namespace Nop.Web.Infrastructure
{
    public partial class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            //install
            routes.MapRoute("Installation",
                            "install",
                            new { area = "Commerce", controller = "Install", action = "Index" },
                            new[] { "Nop.Web.Controllers" });

            //products
            routes.MapLocalizedRoute("RecentlyViewedProducts",
                            "recentlyviewedproducts/",
                            new { area = "Commerce", controller = "Catalog", action = "RecentlyViewedProducts" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("RecentlyAddedProducts",
                            "newproducts/",
                            new { area = "Commerce", controller = "Catalog", action = "RecentlyAddedProducts" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("RecentlyAddedProductsRSS",
                            "newproducts/rss",
                            new { area = "Commerce", controller = "Catalog", action = "RecentlyAddedProductsRss" },
                            new[] { "Nop.Web.Controllers" });

            //comparing products
            routes.MapLocalizedRoute("AddProductToCompare",
                            "compareproducts/add/{productId}",
                            new { area = "Commerce", controller = "Catalog", action = "AddProductToCompareList" },
                            new { productId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CompareProducts",
                            "compareproducts/",
                            new { area = "Commerce", controller = "Catalog", action = "CompareProducts" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("RemoveProductFromCompareList",
                            "compareproducts/remove/{productId}",
                            new { area = "Commerce", controller = "Catalog", action = "RemoveProductFromCompareList" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ClearCompareList",
                            "clearcomparelist/",
                            new { area = "Commerce", controller = "Catalog", action = "ClearCompareList" },
                            new[] { "Nop.Web.Controllers" });

            //product email a friend
            routes.MapLocalizedRoute("ProductEmailAFriend",
                            "productemailafriend/{productId}",
                            new { area = "Commerce", controller = "Catalog", action = "ProductEmailAFriend" },
                            new { productId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //catalog
            routes.MapLocalizedRoute("ManufacturerList",
                            "manufacturer/all/",
                            new { area = "Commerce", controller = "Catalog", action = "ManufacturerAll" },
                            new[] { "Nop.Web.Controllers" });
            //downloads
            routes.MapRoute("GetSampleDownload",
                            "download/sample/{productvariantid}",
                            new { area = "Commerce", controller = "Download", action = "Sample" },
                            new { productvariantid = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapRoute("GetDownload",
                            "download/getdownload/{opvid}/{agree}",
                            new { area = "Commerce", controller = "Download", action = "GetDownload", agree = UrlParameter.Optional },
                            new { opvid = new GuidConstraint(false) },
                            new[] { "Nop.Web.Controllers" });
            routes.MapRoute("GetLicense",
                            "download/getlicense/{opvid}/",
                            new { area = "Commerce", controller = "Download", action = "GetLicense" },
                            new { opvid = new GuidConstraint(false) },
                            new[] { "Nop.Web.Controllers" });

            //reviews
            routes.MapLocalizedRoute("ProductReviews",
                            "productreviews/{productId}",
                            new { area = "Commerce", controller = "Catalog", action = "ProductReviews" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapRoute("SetProductReviewHelpfulness",
                            "setproductreviewhelpfulness",
                            new { area = "Commerce", controller = "Catalog", action = "SetProductReviewHelpfulness" },
                            new[] { "Nop.Web.Controllers" });

            //back in stock notifications
            routes.MapLocalizedRoute("BackInStockSubscribePopup",
                            "backinstocksubscribe/{productVariantId}",
                            new { area = "Commerce", controller = "Catalog", action = "BackInStockSubscribePopup" },
                            new { productVariantId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //shopping cart
            routes.MapLocalizedRoute("ShoppingCart",
                            "cart/",
                            new { area = "Commerce", controller = "ShoppingCart", action = "Cart" },
                            new[] { "Nop.Web.Controllers" });
            //wishlist
            routes.MapLocalizedRoute("Wishlist",
                            "wishlist/{customerGuid}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("EmailWishlist",
                            "emailwishlist",
                            new { area = "Commerce", controller = "ShoppingCart", action = "EmailWishlist" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("AddtoCartfromWishlist",
                            "addtocartfromwishlist/{productId}/{customerGuid}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "AddtoCartFromWishlist", productId = UrlParameter.Optional, customerGuid = UrlParameter.Optional },
                            new { productId = @"\d*" },
                            new[] { "Nop.Web.Controllers" });
            //add product to cart (without any attributes and options)
            routes.MapLocalizedRoute("AddProductToCart",
                            "addproducttocart/{productId}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "AddProductToCart" },
                            new { productId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            //add product variant to cart (with attributes and options)
            routes.MapLocalizedRoute("AddProductVariantToCart",
                            "addproductvarianttocart/{productVariantId}/{shoppingCartTypeId}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "AddProductVariantToCart" },
                            new { productVariantId = @"\d+", shoppingCartTypeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            //remove product from cart
            routes.MapLocalizedRoute("RemoveProductFromCart",
                            "removeproductfromcart/{productVariantId}/{shoppingCartTypeId}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "RemoveProductFromCart" },
                            new { productVariantId = @"[\d_]+", shoppingCartTypeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("RemoveAllProductsFromCart",
                            "removeallproductsfromcart/{shoppingCartTypeId}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "RemoveAllProductsFromCart" },
                            new { shoppingCartTypeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            //product attributes with "upload file" type
            routes.MapLocalizedRoute("UploadFileProductAttribute",
                            "uploadfileproductattribute/{productVariantId}/{productAttributeId}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "UploadFileProductAttribute" },
                            new { productVariantId = @"\d+", productAttributeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });


            //ReturnRequest
            routes.MapLocalizedRoute("ReturnRequestOpcSelectAddress",
                           "ReturnRequest/OpcSelectAddress",
                           new { area = "Commerce", controller = "ReturnRequest", action = "OpcSelectAddress" },
                           new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ReturnRequestOpcAddressForm",
                           "ReturnRequest/OpcAddressForm",
                           new { area = "Commerce", controller = "ReturnRequest", action = "OpcAddressForm" },
                           new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ReturnRequestOpcDeleteAddress",
                           "ReturnRequest/OpcDeleteAddress",
                           new { area = "Commerce", controller = "ReturnRequest", action = "OpcDeleteAddress" },
                           new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ReturnRequestOpcSaveAddress",
                           "ReturnRequest/OpcSaveAddress",
                           new { area = "Commerce", controller = "ReturnRequest", action = "OpcSaveAddress" },
                           new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ReturnRequestOpcEditSection",
              "ReturnRequest/OpcEditSection",
              new { area = "Commerce", controller = "ReturnRequest", action = "OpcEditSection" },
              new[] { "Nop.Web.Controllers" });


            //checkout
            routes.MapLocalizedRoute("Checkout",
                            "checkout/page/{storeId}",
                            new { area = "Commerce", controller = "Checkout", action = "Index" },
                            new { storeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOnePage",
                            "checkout/{type}/{id}",
                            new { area = "Commerce", controller = "Checkout", action = "OnePageCheckout" },
                            new { type = "o|s", id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutShippingAddress",
                            "checkout/shippingaddress",
                            new { area = "Commerce", controller = "Checkout", action = "ShippingAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutSelectShippingAddress",
                            "checkout/selectshippingaddress",
                            new { area = "Commerce", controller = "Checkout", action = "SelectShippingAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("UpdateShippingAddress",
                            "checkout/updateshippingaddress",
                            new { area = "Commerce", controller = "Checkout", action = "UpdateShippingAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutBillingAddress",
                            "checkout/billingaddress",
                            new { area = "Commerce", controller = "Checkout", action = "BillingAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutSelectBillingAddress",
                            "checkout/selectbillingaddress",
                            new { area = "Commerce", controller = "Checkout", action = "SelectBillingAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("UpdateBillingAddress",
                            "checkout/updatebillingaddress",
                            new { area = "Commerce", controller = "Checkout", action = "UpdateBillingAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutAddress",
                            "checkout/address",
                            new { area = "Commerce", controller = "Checkout", action = "Address" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutCompleteAddress",
                            "checkout/completeaddress",
                            new { area = "Commerce", controller = "Checkout", action = "CheckoutCompleteAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutShippingMethod",
                            "checkout/shippingmethod",
                            new { area = "Commerce", controller = "Checkout", action = "ShippingMethod" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutPaymentMethod",
                            "checkout/paymentmethod",
                            new { area = "Commerce", controller = "Checkout", action = "PaymentMethod" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutPaymentInfo",
                            "checkout/paymentinfo",
                            new { area = "Commerce", controller = "Checkout", action = "PaymentInfo" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutConfirm",
                            "checkout/confirm",
                            new { area = "Commerce", controller = "Checkout", action = "Confirm" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutCompleted",
                            "checkout/completed",
                            new { area = "Commerce", controller = "Checkout", action = "Completed" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcSaveShippingMethod",
                            "checkout/OpcSaveShippingMethod",
                            new { area = "Commerce", controller = "Checkout", action = "OpcSaveShippingMethod" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcAddressForm",
                            "checkout/OpcAddressForm",
                            new { area = "Commerce", controller = "Checkout", action = "OpcAddressForm" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcSaveAddress",
                            "checkout/OpcSaveAddress",
                            new { area = "Commerce", controller = "Checkout", action = "OpcSaveAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcSelectAddress",
                            "checkout/OpcSelectAddress",
                            new { area = "Commerce", controller = "Checkout", action = "OpcSelectAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcDeleteAddress",
                            "checkout/OpcDeleteAddress",
                            new { area = "Commerce", controller = "Checkout", action = "OpcDeleteAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcSavePaymentInfo",
                            "checkout/OpcSavePaymentInfo",
                            new { area = "Commerce", controller = "Checkout", action = "OpcSavePaymentInfo" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcSavePaymentMethod",
                            "checkout/OpcSavePaymentMethod",
                            new { area = "Commerce", controller = "Checkout", action = "OpcSavePaymentMethod" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcPaymentInfo",
                            "checkout/OpcPaymentInfo",
                            new { area = "Commerce", controller = "Checkout", action = "OpcPaymentInfo" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcLoadStepAfterAddress",
                            "checkout/OpcLoadStepAfterAddress",
                            new { area = "Commerce", controller = "Checkout", action = "OpcLoadStepAfterAddress" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcEditSection",
                           "checkout/OpcEditSection",
                           new { area = "Commerce", controller = "Checkout", action = "OpcEditSection" },
                           new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("CheckoutOpcConfirmOrder",
                            "checkout/OpcConfirmOrder",
                            new { area = "Commerce", controller = "Checkout", action = "OpcConfirmOrder" },
                            new[] { "Nop.Web.Controllers" });

            //PreOrderCheckOut
            routes.MapLocalizedRoute("PreOrderOnePageCheckOut",
                            "checkout/PreOrderOnePageCheckOut",
                            new { area = "Commerce", controller = "Checkout", action = "PreOrderOnePageCheckOut" },
                            new[] { "Nop.Web.Controllers" });

            //Add ReserveCart
            routes.MapLocalizedRoute("ReserveProductVariant",
                            "catalog/ReserveProductVariant",
                            new { area = "Commerce", controller = "Catalog", action = "ReserveProductVariant" },
                            new[] { "Nop.Web.Controllers" });

            //orders
            routes.MapLocalizedRoute("OrderDetails",
                            "orderdetails/{orderId}",
                            new { area = "Commerce", controller = "Order", action = "Details" },
                            new { orderId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
			routes.MapLocalizedRoute("CommerceCancelOrder",
							"cancelorder/{orderId}",
							new { area = "Commerce", controller = "Order", action = "Cancel" },
							new { orderId = @"\d+" },
							new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("AjaxCancelOrder",
                            "cancelorder/ajaxcancelorder/{orderId}",
                            new { area = "Commerce", controller = "Order", action = "AjaxCancel" },
                            new { orderId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ShipmentDetails",
                            "orderdetails/shipment/{shipmentId}",
                            new { area = "Commerce", controller = "Order", action = "ShipmentDetails" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("AjaxShipmentDetails",
                            "orderdetails/ajaxshipmentdetails",
                            new { area = "Commerce", controller = "Order", action = "AjaxShipmentDetails" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ReturnRequest",
                            "returnrequest/{orderId}",
                            new { area = "Commerce", controller = "ReturnRequest", action = "ReturnRequest" },
                            new { orderId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ReOrder",
                            "reorder/{orderId}",
                            new { area = "Commerce", controller = "Order", action = "ReOrder" },
                            new { orderId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("GetOrderPdfInvoice",
                            "orderdetails/pdf/{orderId}",
                            new { area = "Commerce", controller = "Order", action = "GetPdfInvoice" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("PrintOrderDetails",
                            "orderdetails/print/{orderId}",
                            new { area = "Commerce", controller = "Order", action = "PrintOrderDetails" },
                            new[] { "Nop.Web.Controllers" });


            //contact us
            routes.MapLocalizedRoute("ContactUs",
                            "contactus",
                            new { area = "Commerce", controller = "Common", action = "ContactUs" },
                            new[] { "Nop.Web.Controllers" });


            //store closed
            routes.MapLocalizedRoute("StoreClosed",
                            "storeclosed",
                            new { area = "Commerce", controller = "Common", action = "StoreClosed" },
                            new[] { "Nop.Web.Controllers" });

            //newsletters
            routes.MapLocalizedRoute("NewsletterActivation",
                            "newsletter/subscriptionactivation/{token}/{active}",
                            new { area = "Commerce", controller = "Newsletter", action = "SubscriptionActivation" },
                            new { token = new GuidConstraint(false) },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("SubscribeNewsletter",
                            "subscribenewsletter",
                            new { area = "Commerce", controller = "Newsletter", action = "SubscribeNewsletter" },
                            new[] { "Nop.Web.Controllers" });

            //blog
            routes.MapLocalizedRoute("Blog",
                            "blog",
                            new { area = "Commerce", controller = "Blog", action = "List" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("BlogByTag",
                            "blog/tag/{tag}",
                            new { area = "Commerce", controller = "Blog", action = "BlogByTag" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("BlogByMonth",
                            "blog/month/{month}",
                            new { area = "Commerce", controller = "Blog", action = "BlogByMonth" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("BlogRSS",
                            "blog/rss/{languageId}",
                            new { area = "Commerce", controller = "Blog", action = "ListRss" },
                            new { languageId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("BlogPost",
                            "blog/{blogPostId}/{SeName}",
                            new { area = "Commerce", controller = "Blog", action = "BlogPost", SeName = UrlParameter.Optional },
                            new { blogPostId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //forum
            routes.MapLocalizedRoute("Boards",
                            "boards",
                            new { area = "Commerce", controller = "Boards", action = "Index" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ActiveDiscussions",
                            "boards/activediscussions",
                            new { area = "Commerce", controller = "Boards", action = "ActiveDiscussions" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ActiveDiscussionsRSS",
                            "boards/activediscussionsrss",
                            new { area = "Commerce", controller = "Boards", action = "ActiveDiscussionsRSS" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("PostEdit",
                            "boards/postedit/{id}",
                            new { area = "Commerce", controller = "Boards", action = "PostEdit" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("PostDelete",
                            "boards/postdelete/{id}",
                            new { area = "Commerce", controller = "Boards", action = "PostDelete" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("PostCreate",
                            "boards/postcreate/{id}",
                            new { area = "Commerce", controller = "Boards", action = "PostCreate" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("PostCreateQuote",
                            "boards/postcreate/{id}/{quote}",
                            new { area = "Commerce", controller = "Boards", action = "PostCreate" },
                            new { id = @"\d+", quote = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicEdit",
                            "boards/topicedit/{id}",
                            new { area = "Commerce", controller = "Boards", action = "TopicEdit" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicDelete",
                            "boards/topicdelete/{id}",
                            new { area = "Commerce", controller = "Boards", action = "TopicDelete" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicCreate",
                            "boards/topiccreate/{id}",
                            new { area = "Commerce", controller = "Boards", action = "TopicCreate" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicMove",
                            "boards/topicmove/{id}",
                            new { area = "Commerce", controller = "Boards", action = "TopicMove" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicWatch",
                            "boards/topicwatch/{id}",
                            new { area = "Commerce", controller = "Boards", action = "TopicWatch" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicSlug",
                            "boards/topic/{id}/{slug}",
                            new { area = "Commerce", controller = "Boards", action = "Topic", slug = UrlParameter.Optional },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicSlugPaged",
                            "boards/topic/{id}/{slug}/page/{page}",
                            new { area = "Commerce", controller = "Boards", action = "Topic", slug = UrlParameter.Optional, page = UrlParameter.Optional },
                            new { id = @"\d+", page = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ForumWatch",
                            "boards/forumwatch/{id}",
                            new { area = "Commerce", controller = "Boards", action = "ForumWatch" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ForumRSS",
                            "boards/forumrss/{id}",
                            new { area = "Commerce", controller = "Boards", action = "ForumRSS" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ForumSlug",
                            "boards/forum/{id}/{slug}",
                            new { area = "Commerce", controller = "Boards", action = "Forum", slug = UrlParameter.Optional },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ForumSlugPaged",
                            "boards/forum/{id}/{slug}/page/{page}",
                            new { area = "Commerce", controller = "Boards", action = "Forum", slug = UrlParameter.Optional, page = UrlParameter.Optional },
                            new { id = @"\d+", page = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ForumGroupSlug",
                            "boards/forumgroup/{id}/{slug}",
                            new { area = "Commerce", controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("Search",
                            "boards/search",
                            new { area = "Commerce", controller = "Boards", action = "Search" },
                            new[] { "Nop.Web.Controllers" });


            //private messages
            routes.MapLocalizedRoute("PrivateMessages",
                            "privatemessages/{tab}",
                            new { area = "Commerce", controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("PrivateMessagesPaged",
                            "privatemessages/{tab}/page/{page}",
                            new { area = "Commerce", controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional },
                            new { page = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("PrivateMessagesInbox",
                            "inboxupdate",
                            new { area = "Commerce", controller = "PrivateMessages", action = "InboxUpdate" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("PrivateMessagesSent",
                            "sentupdate",
                            new { area = "Commerce", controller = "PrivateMessages", action = "SentUpdate" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("SendPM",
                            "sendpm/{toCustomerId}",
                            new { area = "Commerce", controller = "PrivateMessages", action = "SendPM" },
                            new { toCustomerId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("SendPMReply",
                            "sendpm/{toCustomerId}/{replyToMessageId}",
                            new { area = "Commerce", controller = "PrivateMessages", action = "SendPM" },
                            new { toCustomerId = @"\d+", replyToMessageId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("ViewPM",
                            "viewpm/{privateMessageId}",
                            new { area = "Commerce", controller = "PrivateMessages", action = "ViewPM" },
                            new { privateMessageId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("DeletePM",
                            "deletepm/{privateMessageId}",
                            new { area = "Commerce", controller = "PrivateMessages", action = "DeletePM" },
                            new { privateMessageId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //news
            routes.MapLocalizedRoute("NewsArchive",
                            "news",
                            new { area = "Commerce", controller = "News", action = "List" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("NewsRSS",
                            "news/rss/{languageId}",
                            new { area = "Commerce", controller = "News", action = "ListRss" },
                            new { languageId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("NewsItem",
                            "news/{newsItemId}/{SeName}",
                            new { area = "Commerce", controller = "News", action = "NewsItem", SeName = UrlParameter.Optional },
                            new { newsItemId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //topics
            routes.MapLocalizedRoute("Topic",
                            "information/{SystemName}",
                            new { area = "Commerce", controller = "Topic", action = "TopicDetails" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicPopup",
                            "t-popup/{SystemName}",
                            new { area = "Commerce", controller = "Topic", action = "TopicDetailsPopup" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicStatic",
                            "ts/{actionName}",
                            new { area = "Commerce", controller = "Topic", action = "TopicStatic", controllerName = "Home", areaName = "" },
                            new[] { "Nop.Web.Controllers" });
            //sitemaps
            routes.MapLocalizedRoute("Sitemap",
                            "sitemap",
                            new { area = "Commerce", controller = "Common", action = "Sitemap" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("SitemapSEO",
                            "sitemapseo",
                            new { area = "Commerce", controller = "Common", action = "SitemapSeo" },
                            new[] { "Nop.Web.Controllers" });

            //product tags
            routes.MapLocalizedRoute("ProductsByTag",
                            "producttag/{productTagId}/{SeName}",
                            new { area = "Commerce", controller = "Catalog", action = "ProductsByTag", SeName = UrlParameter.Optional },
                            new { productTagId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ProductTagsAll",
                            "producttag/all/",
                            new { area = "Commerce", controller = "Catalog", action = "ProductTagsAll" },
                            new[] { "Nop.Web.Controllers" });
            #region Product tag URL fix
            //in versions 2.00-2.65 we had typo in producttag URLs ("productag" instead of "producttag")
            //we should support old "buggy" URLs
            routes.MapLocalizedRoute("ProductsByTag_Fix1",
                            "productag/{productTagId}/{SeName}",
                            new { area = "Commerce", controller = "BackwardCompatibility2X", action = "RedirectProductsByTag", SeName = UrlParameter.Optional },
                            new { productTagId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ProductTagsAll_Fix1",
                            "productag/all/",
                            new { area = "Commerce", controller = "BackwardCompatibility2X", action = "RedirectProductTagsAll" },
                            new[] { "Nop.Web.Controllers" });
            #endregion

            //product search
            routes.MapLocalizedRoute("ProductSearch",
                            "search/",
                            new { area = "Commerce", controller = "Catalog", action = "Search" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ProductSearchAutoComplete",
                            "catalog/searchtermautocomplete",
                            new { area = "Commerce", controller = "Catalog", action = "SearchTermAutoComplete" },
                            new[] { "Nop.Web.Controllers" });

            //config
            routes.MapLocalizedRoute("Config",
                            "config",
                            new { area = "Commerce", controller = "Common", action = "Config" },
                            new[] { "Nop.Web.Controllers" });

            //some AJAX links
            routes.MapRoute("GetStatesByCountryId",
                            "country/getstatesbycountryid/",
                            new { area = "Commerce", controller = "Country", action = "GetStatesByCountryId" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ChangeDevice",
                            "changedevice/{dontusemobileversion}",
                            new { area = "Commerce", controller = "Common", action = "ChangeDevice" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ChangeCurrency",
                            "changecurrency/{customercurrency}",
                            new { area = "Commerce", controller = "Common", action = "CurrencySelected" },
                            new { customercurrency = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ChangeLanguage",
                            "changelanguage/{langid}",
                            new { area = "Commerce", controller = "Common", action = "SetLanguage" },
                            new { langid = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("ChangeTaxType",
                            "changetaxtype/{customertaxtype}",
                            new { area = "Commerce", controller = "Common", action = "TaxTypeSelected" },
                            new { customertaxtype = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapRoute("EuCookieLawAccept",
                            "eucookielawaccept",
                            new { area = "Commerce", controller = "Common", action = "EuCookieLawAccept" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("PollVote",
                            "poll/vote",
                            new { area = "Commerce", controller = "Poll", action = "Vote" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("TopicAuthenticate",
                            "topic/authenticate",
                            new { area = "Commerce", controller = "Topic", action = "Authenticate" },
                            new[] { "Nop.Web.Controllers" });

            //Store
            //TODO: The store routes should be refined with SEO.
            routes.MapLocalizedRoute("StoreList",
                           "store/all/",
                           new { area = "Commerce", controller = "Catalog", action = "StoreAll" },
                           new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("Store",
                            "s/{storeId}/{SeName}",
                            new { area = "Commerce", controller = "Catalog", action = "Store", SeName = UrlParameter.Optional },
                            new { storeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("StoreStdLink",
                            "Commerce/Catalog/Store/{storeId}",
                            new { controller = "Catalog", action = "Store", area = "Commerce" },
                            new { storeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });


            //Categories (for per-store)
            routes.MapLocalizedRoute("PerStoreCategory",
                            "s/{storeId}/c/{categoryId}/{SeName}",
                            new { area = "Commerce", controller = "Catalog", action = "Category", SeName = UrlParameter.Optional },
                            new { categoryId = @"\d+", storeId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("Categories",
                            "categories",
                            new { area = "Commerce", controller = "Catalog", action = "Categories"},
                            new[] { "Nop.Web.Controllers" });

            //Buy now (with attributes and options)
            routes.MapLocalizedRoute("BuyNowProductVariant",
                            "buynowproductvariant/{productVariantId}",
                            new { area = "Commerce", controller = "ShoppingCart", action = "BuyNowProductVariant" },
                            new { productVariantId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //robots.txt
            routes.MapRoute("robots.txt",
                            "robots.txt",
                            new { area = "Commerce", controller = "Common", action = "RobotsTextFile" },
                            new[] { "Nop.Web.Controllers" });


        }

        public int Priority
        {
            get
            {
                return 0;
            }
        }
    }
}
